package com.sky.mapper;

import com.sky.entity.OrderDetail;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface OrderDetailMapper {

    //批量插入订单明细数据
    void insertBatch(List<OrderDetail> orderDetails);

    //根据订单id查询订单详情
    List<OrderDetail> getByOrderId();

    /**
     * 根据Id查询订单详情
     * @param id
     * @return
     */
    List<OrderDetail> getDetailsById(Integer id);

    //根据订单号 查询该订单号的订单明细
    @Select("select * from order_detail where order_id =#{oldOrderId}")
    List<OrderDetail> listOrderDetailByOrderIdxzs(Long oldOrderId);

    //根据id获取订单信息
    List<OrderDetail> getByOrderId(Long id);
}
